package io;

import java.io.*;
import java.nio.charset.StandardCharsets;

/**
 * 缓冲输出流写出数据的缓冲区问题
 */
public class FlushDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("bos.txt");
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        String str = "斑马斑马你不要睡着啦 让我看看你受伤的尾巴";
        byte[] data = str.getBytes(StandardCharsets.UTF_8);
        bos.write(data);
        bos.close();
        System.out.println("写出完毕");



    }
}
